<?php

/**
 * ClienteNatural form.
 *
 * @package    blackDrums
 * @subpackage form
 * @author     your name here
 */
class ClienteNaturalForm extends BaseClienteNaturalForm {
    public function configure() {

        $telefonoCliente = new Telefono();
        $telefonoCliente->setClienteNatural($this->getObject());
        $form = new TelefonoForm($telefonoCliente);
        $this->embedForm('telefono', $form);

        $this->widgetSchema['cedula'] = new sfWidgetFormInputText();
        $this->validatorSchema['cedula'] = new sfValidatorInteger();

        $this->widgetSchema->setLabels(array(
                'ban_cli_list'    => 'Bandas',
        ));

        $this->setValidators(array(
                'cedula'       => new sfValidatorPropelChoice(array('model' => 'ClienteNatural', 'column' => 'cedula', 'required' => false), array ('required' => 'Por favor indique la cedula del cliente')),
                'nombre'       => new sfValidatorString(array('max_length' => 30), array ('required' => 'Por favor indique el nombre del cliente')),
                'apellido'     => new sfValidatorString(array('max_length' => 35), array ('required' => 'Por favor indique el apellido del cliente')),
                'email'        => new sfValidatorString(array('max_length' => 40),array ('required' => 'Por favor indique el email del cliente')),
                'ban_cli_list' => new sfValidatorPropelChoice(array('multiple' => true, 'model' => 'Banda', 'required' => false)),
        ));
    }
}
